package com.ufo.store.management.common;

import android.content.SharedPreferences;
import com.ufo.store.management.BarApplication;

/**
 * Created by taoli on 2016/6/28.
 */
public class Config {
    /**SharedPreferences 存储名字前缀*/
    public static final String PREFIX = "com.zjgd.store";
    public static SharedPreferences AppInfoPreferences = BarApplication.getInstance().getSharedPreferences(PREFIX, 0);

    /**列表样式设置*/
    private static final String KEY_FASTFOOD_STOCK_LIST_STYLE ="KEY_FASTFOOD_STOCK_LIST_STYLE";

    public static int getFastfoodStockListStyle() {
        return AppInfoPreferences.getInt(KEY_FASTFOOD_STOCK_LIST_STYLE, 2);
    }
    public static void setFastfoodStockListStyle(int style) {
        AppInfoPreferences.edit().putInt(KEY_FASTFOOD_STOCK_LIST_STYLE, style).commit();
    }

    private static final String KEY_FASTFOOD_MEMBER_LIST_STYLE ="KEY_FASTFOOD_MEMBER_LIST_STYLE";

    public static int getFastfoodMemberListStyle() {
        return AppInfoPreferences.getInt(KEY_FASTFOOD_MEMBER_LIST_STYLE, 2);
    }
    public static void setFastfoodMemberListStyle(int style) {
        AppInfoPreferences.edit().putInt(KEY_FASTFOOD_MEMBER_LIST_STYLE, style).commit();
    }

    private static final String KEY_ISSZMBALV3_STOCK_LIST_STYLE ="KEY_ISSZMBALV3_STOCK_LIST_STYLE";

    public static int getIsszmbalv3StockListStyle() {
        return AppInfoPreferences.getInt(KEY_ISSZMBALV3_STOCK_LIST_STYLE, 2);
    }
    public static void setIsszmbalv3StockListStyle(int style) {
        AppInfoPreferences.edit().putInt(KEY_ISSZMBALV3_STOCK_LIST_STYLE, style).commit();
    }

    private static final String KEY_ISSZMBALV3_MEMBER_LIST_STYLE ="KEY_ISSZMBALV3_MEMBER_LIST_STYLE";

    public static int getIsszmbalv3MemberListStyle() {
        return AppInfoPreferences.getInt(KEY_ISSZMBALV3_MEMBER_LIST_STYLE, 2);
    }
    public static void setIsszmbalv3MemberListStyle(int style) {
        AppInfoPreferences.edit().putInt(KEY_ISSZMBALV3_MEMBER_LIST_STYLE, style).commit();
    }


    /**数据库同步时间设置*/
    private static final String KEY_FASTFOOD_SYSNC_DATABASE_TIME_LAST ="KEY_FASTFOOD_SYSNC_DATABASE_TIME_LAST";

    public static long getFastfoodLastSysncTime() {
        return AppInfoPreferences.getLong(KEY_FASTFOOD_SYSNC_DATABASE_TIME_LAST, -1);
    }
    public static void setFastfoodLastSysncTime(long time) {
        AppInfoPreferences.edit().putLong(KEY_FASTFOOD_SYSNC_DATABASE_TIME_LAST, time).commit();
    }

    private static final String KEY_ISSZMBALV3_SYSNC_DATABASE_TIME_LAST ="KEY_ISSZMBALV3_SYSNC_DATABASE_TIME_LAST";

    public static long getIsszmbalv3LastSysncTime() {
        return AppInfoPreferences.getLong(KEY_ISSZMBALV3_SYSNC_DATABASE_TIME_LAST, -1);
    }
    public static void setIsszmbalv3LastSysncTime(long time) {
        AppInfoPreferences.edit().putLong(KEY_ISSZMBALV3_SYSNC_DATABASE_TIME_LAST, time).commit();
    }

    /**本地授权密钥*/
    private static final String KEY_COPYRIGHT_ENCODE ="KEY_COPYRIGHT_ENCODE";

    public static String getCopyrightNumber() {
        return AppInfoPreferences.getString(KEY_COPYRIGHT_ENCODE, "");
    }
    public static void setCopyrightNumber(String s) {
        AppInfoPreferences.edit().putString(KEY_COPYRIGHT_ENCODE, s).commit();
    }

    /**报表查看时间设置*/
    private static final String KEY_FASTFOOD_BILL_CHECK_TIME ="KEY_FASTFOOD_BILL_CHECK_TIME";

    public static long getFastfoodBillCheckTime() {
        return AppInfoPreferences.getLong(KEY_FASTFOOD_BILL_CHECK_TIME, -1);
    }
    public static void setFastfoodBillCheckTime(long time) {
        AppInfoPreferences.edit().putLong(KEY_FASTFOOD_BILL_CHECK_TIME, time).commit();
    }

    private static final String KEY_ISSZMBALV3_BILL_CHECK_TIME ="KEY_ISSZMBALV3_BILL_CHECK_TIME";

    public static long getIsszmbalv3BillCheckTime() {
        return AppInfoPreferences.getLong(KEY_ISSZMBALV3_BILL_CHECK_TIME, -1);
    }
    public static void setIsszmbalv3BillCheckTime(long time) {
        AppInfoPreferences.edit().putLong(KEY_ISSZMBALV3_BILL_CHECK_TIME, time).commit();
    }
}
